Skip to content

Core: Work around more IE activeElement bugs #1523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

scottgonzalez
Copy link
Member

Amazingly 76c2755 caused regressions because IE 9 - 11 can return null for document.activeElement when not in an iframe. The fun never stops when dealing with focus in IE...

// Support: IE 9 - 11 only
// IE may return null instead of an element
// Interestingly, this only seems to occur when NOT in an iframe
if ( !activeElement ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this just be combined in the conditional below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the clarity of what workarounds exist over the minuscule byte savings of combining.

@dmethvin
Copy link
Member

I was a bit concerned about uses of safeActiveElement returning body but I see that in at least a few places where it's blurred you're taking care to avoid the IE body blur bug, e.g.

$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );

https://github.com/scottgonzalez/jquery-ui/blob/ie-activeelement/ui/core.js#L84-90

And I still hate focus/blur.

@jzaefferer
Copy link
Member

Looks "good" to me (as good as these can get). I prefer the separate if statement as well, since that keeps the support comments separate.

@scottgonzalez scottgonzalez deleted the ie-activeelement branch March 29, 2015 13:51
scottgonzalez added a commit that referenced this pull request Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants